import request from "@/utils/request";
import type { RequestParams, ResponseData, BookRequestParams } from "./type";

// 分页列表
export const bookList = (data: RequestParams) => {
  return request<ResponseData<BookRequestParams>, any>({
    url: "/api/v1/publicSentiment/page",
    method: "post",
    data,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const addbook = (data: BookRequestParams) => {
  return request<ResponseData<BookRequestParams>, any>({
    url: "/api/v1/publicSentiment/add",
    method: "post",
    data,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const delbook = (id: number) => {
  return request<ResponseData<BookRequestParams>, any>({
    url: "/api/v1/publicSentiment/delete",
    method: "post",
    data: id,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const Formbook = (id: number) => {
  return request<ResponseData<BookRequestParams>, any>({
    url: "/api/v1/publicSentiment/form",
    method: "post",
    data: id,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const updatebook = (id: number) => {
  return request<ResponseData<BookRequestParams>, any>({
    url: "/api/v1/publicSentiment/update",
    method: "post",
    data: id,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
